<script setup lang="ts">
import { onMounted, ref } from 'vue';
import api from '@/api';
import { useRouter } from 'vue-router'
import PersonReport from "./personReport/index.vue";

const props = defineProps({
    id: {
        type: String,
        default: () => null
    },
})
const { } = api;
const reportState=ref("正在加载报告...");
const reportId=ref<string|string[]>("0");
const reportData=ref(null);
const router = useRouter()
const getReportData=async ()=>{
    reportId.value = props.id ?? router.currentRoute.value.query.id;
    // const reportRes = await getPublicPersonReport({ id:reportId.value });
    // return reportRes.data;
}
const pageLoad=async ()=>{
    reportData.value=await getReportData();         
    reportState.value="ok"
}
//onMounted(async () => {
pageLoad().then(()=>{
    
}) 
//})

</script>
<template>  
    <PersonReport :data="reportData" :showDownload="!!props.id"/>        
</template>